home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d7 / lib231.arc / PCBOARD.SLT < prev    next >
Text File  |  1990-05-11  |  6KB  |  151 lines

  1. ////////////////////////////// PCBOARD.SLT ///////////////////////////////////
  2. //
  3. //  PCBBOARD.SLT Copyright (C) 1990 Liberation Enterprises.
  4. //
  5. //  DESCRIPTION:  This Telix script is designed to logon to a PCBoard v14
  6. //  based BBS system.  It will take you from the initial PCBoard connection
  7. //  to the main menu (or conference main menu, if defined below).
  8. //
  9. //  INSTRUCTIONS:  Simply change the variables below to the desired values and
  10. //  compile for use with Telix with the command CS PCBOARD.  The script
  11. //  should also be linked to your Telix dialing directory, in the Linked
  12. //  Script option of PCBoard entries.  Simply type PCBOARD.SLC in the option
  13. //  to do so.  Your PCBoard password must also be placed in the Telix dire-
  14. //  ctory entry near the bottom.
  15. ////
  16.  
  17. int d = 0;      // response delay... 10ths/sec same as in The Liberator.
  18.                 // Increase to 5 or 10 if the script responds to questions
  19.                 // too quickly.
  20.  
  21. str user_name[] =  "Wayne Duff", // Place your PCBoard user name here
  22.     lang_num[] =   "1",          // ignore if only 1 language on board
  23.     ansi_graph[] = "N",          // ANSI Color?  Y = Yes, N = No
  24.     conference[] = "";           // conference to join at logon:  "" = none
  25.  
  26. ////
  27. //
  28. //  Everything from this point on may be ignored.  See the track() statements
  29. //  below to modify prompts if necessary...  Make sure you compile this script
  30. //  whenever any changes are made.  
  31. //
  32. //////////////////////////////////////////////////////////////////////////////
  33. main()
  34. {
  35.  int timeout,                    // int for a timer handle
  36.      success = 0,                // set to FALSE (0)--TRUE if successful logon
  37.      pass_tries = 3,             // in case of a bad password... when 0 give up
  38.      prompt,                     // stores track handles found by track_hit()
  39.      language,                   // ints used as track() handles
  40.      graphics,
  41.      name,
  42.      password,
  43.      more,
  44.      scan_msg,
  45.      pause,
  46.      pcb_main,
  47.      pcb_conf;
  48.  str s[10];                      // general purpose string
  49.  
  50.  clear_scr();
  51.  
  52.  if (not _entry_pass)          // can't log on without a password
  53.   {
  54.    prints("Password Unknown.  Please put it in your dialing directory and try again.");
  55.    return(6);
  56.   }
  57.  
  58.  language = track("(Enter)=no change? ", 1); // Language # to use
  59.  graphics = track("(Enter)=no? ", 1);        // Graphics prompt
  60.  name     = track("first name? ", 1);        // Name prompt
  61.  password = track("Password", 1);            // Password prompt
  62.  more     = track("More? ", 1);              // Bulletin pause prompt
  63.  scan_msg = track("(Enter)=yes? ", 1);       // Scan Message Base
  64.  pause    = track("(Enter) to continue", 1); // Press (Enter) to continue?
  65.  pcb_main = track("Main Board Command? ", 1);
  66.  pcb_conf = track("Conference Command? ", 1);
  67.  
  68.  timeout  = timer_start(1800);               // 3 min. maximum for logon...
  69.                                              //  give up if time expires
  70.  
  71.  // while time_up(timeout) is 'not TRUE' (false) and carrier() is TRUE...
  72.  //  do what's between {}
  73.  
  74.  while (not time_up(timeout) and carrier())
  75.   {
  76.    terminal();                // if you don't use this, nothing gets displayed
  77.                               //  on your screen
  78.  
  79.    prompt = track_hit();      // check which prompt (if any) was found.  If one
  80.                               //  was, its handle number is stored in 'prompt'
  81.  
  82.    if (prompt == language)    // if prompt 'is equal to' the language handle
  83.     cputs_cr(lang_num);
  84.  
  85.    else if (prompt == graphics)
  86.     {
  87.      s = ansi_graph;          // put ansi_graph (defined above) in 's'
  88.      strcat(s, " Q");         //  then strCAT (concatenate... add) " Q" to 's'
  89.      cputs_cr(s);             //  for a 'Q'uiet logon (no welcome screen)
  90.     }
  91.  
  92.    else if (prompt == name)
  93.     cputs_cr(user_name);
  94.  
  95.    else if (prompt == password)
  96.     {
  97.      if (not pass_tries)      // a little extra protection... in case
  98.       break;                  //  you enter the wrong password in your
  99.      cputs_cr(_entry_pass);   //  dialing directory, it will only be tried
  100.      --pass_tries;            //  3 times before the script gives up.
  101.     }                         //  '--pass' is the same as 'pass = pass - 1'
  102.  
  103.    else if (prompt == more or prompt == scan_msg)  // note use of 'or'
  104.     cputs_cr("N");
  105.  
  106.    else if (prompt == pause)
  107.     cputs_cr("");
  108.         
  109.    else if (prompt == pcb_main)
  110.     {
  111.      if (conference)          // if conference isn't empty ("")
  112.       {
  113.        s = "J ";
  114.        strcat(s, conference);
  115.        strcat(s, " Q");
  116.        cputs_cr(s);
  117.        conference = "";      // clear in case we can't join, so we don't try
  118.       }                      //  forever
  119.      else
  120.       {
  121.        success = 1;           // made it to the main menu... set to TRUE
  122.        break;                 // all done... exit (break from) loop
  123.       }
  124.     }
  125.  
  126.    else if (prompt == pcb_conf)
  127.     {
  128.      success = 1;             // made it to the conf. menu
  129.      break;                   // all done... exit loop
  130.     }
  131.   }                           // here's the closing } for while 'loop'
  132.  
  133.  track_free();
  134.  timer_free(timeout);
  135.  
  136.  if (success)
  137.   return(0);                  // made it, return zero
  138.  
  139.  return(29);                  // otherwise, send bad logon abort code
  140. }              
  141.  
  142. //////////////////////////////////////////////////////////////////////////////
  143. cputs_cr(str response)
  144. {
  145.  delay_scr(d);     // response delay... set at beginning of script
  146.  if (response)
  147.   cputs(response);
  148.  cputc('^M');
  149. }
  150.  
  151. //////////////////////////////// End of File /////////////////////////////////